<template>
	<view class="container">
		<view class="content pad30">
			<view class="wztitle">{{title}}</view>
			<view class="wztime" v-if="cate">类型:{{cate}}</view>
			<view class="wztime" v-if="time">发布日期:{{time}}</view>
			<view class="wztime" v-if="desc">简介:{{desc}}</view>
			<view class="wzbox"><rich-text :nodes="content"></rich-text></view>

		</view>
	</view>
</template>

<script>
	import API from "@/common/api.js"
	export default {
		data() {
			return {
				title: '',
				time: '',
				desc:'',
				content: '',
				cate:'',
			}
		},
		onLoad(e) {
			var $this = this
			if (e.from == 'xieyi') {
				API.post("common/helpdetail", {
					id: "xieyi"
				}).then((res) => {
					if (res.code == 1) {
						this.title = res.data.name;
						this.desc = "";
						this.time = "";
						this.cate = "";
						this.content = res.data.content;
					}
				})
			} else if (e.ggid > 0) {
				API.post("common/noticedetail", {
					id: e.ggid
				}).then((res) => {
					if (res.code == 1) {
						this.title = res.data.name;
						this.time = res.data.time;
						this.content = res.data.content;
						this.desc = res.data.desc;
						this.cate = res.data.cate;
					}
				})
			} else {
				API.post("common/helpdetail", {
					id: e.id
				}).then((res) => {
					if (res.code == 1) {
						this.title = res.data.name;
						this.time = res.data.time;
						this.content = res.data.content;
					}
				})

			}
			console.log(e)
		},
		methods: {

		}
	}
</script>

<style lang="scss">
	.wztitle {
		font-size: 44rpx;
		font-weight: bold;
		margin-top: 30rpx;
	}

	.wztime {
		color: #999;
		margin-top: 20rpx;
		font-size: 28rpx;
	}

	.wzbox {
		font-size: 30rpx;
		line-height: 56rpx;
		padding: 40rpx 0;
		width: 100%;
		overflow: hidden;
	}
</style>